package com.asiainfo_linkage.service;

import java.util.List;

import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.pager.Pager;
import org.nutz.dao.sql.Criteria;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.service.EntityService;

import com.asiainfo_linkage.model.AddGroup;
import com.asiainfo_linkage.vo.GroupQuery;


@IocBean

public class GroupQueryService extends EntityService<AddGroup>{
	
	@Inject
	protected Dao dao;
	/**
	 * 查询初始页面当前是否有列表数据展示。
	 */
	public List<AddGroup> pageQuery(GroupQuery groupQuery, Pager pager){
		if(groupQuery==null){
			groupQuery = new GroupQuery();
		}
		if(pager==null){
			pager = new Pager();
		}
		Criteria cri = Cnd.cri();
		pager.setRecordCount(this.dao().count(AddGroup.class, cri));
		return this.dao().query(AddGroup.class, cri, pager);
	}
}
